package com.approval.approvalapp.myself.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;
import android.widget.TextView;

import com.alibaba.fastjson.JSON;
import com.approval.approvalapp.R;
import com.approval.approvalapp.bean.WdbsBean;
import com.approval.approvalapp.index.dbsx.zxhf.adapter.WdbsAdapter;
import com.approval.approvalapp.util.base.BaseActivity;
import com.approval.approvalapp.util.net.NetRequsetUtil;
import com.approval.approvalapp.util.net.interfacepac.NetDownResponse;

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class WdbsActivity extends BaseActivity {

    @Bind(R.id.back_iv)
    ImageView backIv;
    @Bind(R.id.titleTv1)
    TextView titleTv1;
    @Bind(R.id.rv)
    RecyclerView rv;

    @Override
    public int getLayoutId() {
        return R.layout.activity_wdbs;
    }

    @Override
    public void initView() {
        NetRequsetUtil.getInstance().netRequestGet("v1/Center/message", new NetDownResponse() {
            @Override
            public void success(String str) {
                List<WdbsBean> wdbsBeans = JSON.parseArray(str, WdbsBean.class);
                rv.setLayoutManager(new LinearLayoutManager(WdbsActivity.this));
                WdbsAdapter wdbsAdapter = new WdbsAdapter();
                wdbsAdapter.setWdbsBeans(wdbsBeans);
                rv.setAdapter(wdbsAdapter);
            }

            @Override
            public void errowithresponse(String str) {

            }

            @Override
            public void erro() {

            }

            @Override
            public void finish() {

            }
        });

    }

    @Override
    public void initData() {

    }


    @OnClick(R.id.back_iv)
    public void onViewClicked() {
        finish();
    }
}
